﻿namespace ClassLibrary.BusinessLayer.Facade
{
    using ClassLibrary.BusinessLayer.BusinessObjects;
    using ClassLibrary.DataLayer.DataObjects;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.Common;

    [DataObject(true)]
    public class ProjectsFacade
    {
        private IProjectsDAO ProjectsDAO = DAOAccess.ProjectsDAO;

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public bool AddProjects(Projects clsProjects)
        {
            return this.ProjectsDAO.InsertProjects(clsProjects);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public int AddProjectsAndReturnIdentity(Projects clsProjects)
        {
            return this.ProjectsDAO.InsertProjectsReturnIdentity(clsProjects);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public string AddProjectsAndReturnOutput(Projects clsProjects)
        {
            return this.ProjectsDAO.InsertProjectsReturnOutput(clsProjects);
        }

        [DataObjectMethod(DataObjectMethodType.Delete)]
        public bool DeleteProjects(Projects clsProjects)
        {
            return this.ProjectsDAO.DeleteProjects(clsProjects);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Projects> GetProjects(Projects clsProjects)
        {
            return this.ProjectsDAO.GetProjects(clsProjects);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Projects> GetProjects(string Projects)
        {
            Projects clsProjects = new Projects();
            clsProjects._ProjectCode = Projects;
            return this.ProjectsDAO.GetProjects(clsProjects);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Projects> GetsProjects()
        {
            return this.ProjectsDAO.GetsProjects();
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public DataTable GetsProjects(string SPName, DbParameter[] param)
        {
            return this.ProjectsDAO.GetsProjects(SPName, param);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Projects> ListProjects(Projects clsProjects)
        {
            return this.ProjectsDAO.ListProjects(clsProjects);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Projects> ListProjects(string Projects)
        {
            Projects clsProjects = new Projects();
            clsProjects._ProjectCode = Projects;
            return this.ProjectsDAO.ListProjects(clsProjects);
        }

        [DataObjectMethod(DataObjectMethodType.Update)]
        public bool UpdateProjects(Projects clsProjects)
        {
            return this.ProjectsDAO.UpdateProjects(clsProjects);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public int UpdateProjects(string SPName, DbParameter[] param)
        {
            return this.ProjectsDAO.UpdateProjects(SPName, param);
        }
    }
}

